<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>FastAPI CORS Example</title>
</head>
<body>
    <h1>FastAPI CORS Example</h1>
    <button onclick="getData()">Get Data</button>
    <p id="result"></p>
    <script>
        async function getData() {
            try {
                const response = await fetch('http://localhost:8000/get_data');
                const data = await response.json();
                document.getElementById('result').innerHTML = `Data: ${JSON.stringify(data)}`;
            } catch (error) {
                console.error(error);
                document.getElementById('result').innerHTML = 'Error fetching data';
            }
        }
    </script>
</body>
</html>
